package com.coder.oj.common.config;

import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@MapperScan(value = "com.coder.oj.common.mapper")
@EnableTransactionManagement
public class DataBatisPlusConfig {

	/**
	 * 分页插件
	 * @author Bosen 2022/11/24 10:55
	 **/
	@Bean
	public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
	}

	/**
	 * 自动填充 
	 * @author Bosen 2022/11/24 10:55
	 **/
	@Bean
	public DataMetaObjectHandler dataMetaObjectHandler() {
		return new DataMetaObjectHandler();
	}
}
